home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
escalant
/
escala21.lha
/
escalante2.1
/
src
/
editor
/
Escalante.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-15
|
3KB
|
176 lines
//
// Copyright (C) 1993 Jeff McWhirter
//
#ifndef ESCALANTE_H
#define ESCALANTE_H
#include "EscalanteGlobal.h"
#include "Application.h"
#include "Document.h"
#include "VGraphElement.h"
#include "VRelation.h"
#ifdef USE_STRUCTURAL
#include "SGraphElement.h"
#include "SRelation.h"
#endif
#include "EscalanteView.h"
class VGraphElement;
class ObjList;
#define CallViewFunc(func)\
EscalanteView * viewptr;\
Iter next(views);\
while(viewptr = (EscalanteView*)next())\
viewptr->func
extern char *cDocTypeBasic;
extern char *cDocTypeSgVgs;
extern char *cDocTypeSgVg;
inline void gChanged(){gGraphModified = TRUE;}
static int cIdEscalanteView = 10000;
const int cIdEscalanteViewInc = 5000;
#define EscalanteDocument_BASE Document
class EscalanteDocument : public EscalanteDocument_BASE {
public:
VGraphElement* vgraph;
ObjList* views;
MetaDef(EscalanteDocument);
EscalanteDocument(VGraphElement * vg);
~EscalanteDocument();
virtual EscalanteView * MakeEscalanteView(int,
Point,
VGraphElement *);
bool Close();
void MyClose();
void AddEscalanteView(BaseEscalanteView* view){
if(!views) views = new ObjList();
views->Add((Object*)view);
}
MenuBar *DoMakeMenuBar();
void DoSetupMenu(Menu*);
Command *DoMenuCommand(int);
VObject *DoMakeContent();
void Control(int id, int part, void *val);
};
class ObserverDocument : public EscalanteDocument {
public:
EscalanteView * theview;
ObserverDocument(VGraphElement * vg,
EscalanteView* tv):EscalanteDocument(vg){theview = tv;}
VObject *DoMakeContent();
//MenuBar *DoMakeMenuBar(){return 0;}
};
#define EscalanteManager_BASE Document
enum EscalanteManFlags{eEscalanteManModified = BIT(eEvtLast+1),
eEscalanteManLast = eEvtLast+1};
class EscalanteManager : public Document {
public:
SGraphElement* sgraph;
ObjList* vgraphs;
MetaDef(EscalanteManager);
EscalanteManager(SGraphElement * sg,
class ObjList * vg,
char * docType =cDocTypeSgVgs ):EscalanteManager_BASE(docType){
sgraph = sg; vgraphs =vg;Modified(FALSE);
}
VObject* DoMakeContent();
virtual EscalanteDocument* NewEscalanteDocument(VGraphElement*);
virtual EscalanteDocument * MakeEscalanteDocument(VGraphElement*);
bool DoRead(IStream&, Data *data); // return TRUE if OK
bool DoWrite(OStream&, Data *data); // return TRUE if OK
bool Modified();
void Modified(bool b){SetFlag(eEscalanteManModified,b);}
bool Close();
};
extern EscalanteManager* gEscalanteManager;
#define Escalante_BASE Application
class Escalante: public Application {
public:
ObjList* vgs;
SGraphElement* sg;
MetaDef(Escalante);
Escalante(int argc, char **argv);
~Escalante();
virtual EscalanteManager* MakeEscalanteManager(SGraphElement * sg,ObjList * vgs);
virtual void MakeGraph(SGraphElement *&, ObjList *&){}
Manager* DoMakeManager(Symbol type);
bool CanOpen(Data *data);
Command * DoMenuCommand(int );
};
#define PaletteDocument_BASE Document
class PaletteDocument: public PaletteDocument_BASE{
public:
EscalanteView* view;
class CollectionView* palette;
ObjList* tools;
VObject* paletteWrapper;
PaletteDocument(EscalanteView*);
void Control(int id, int p, void *v);
MenuBar* DoMakeMenuBar(){return 0;}
VObject* DoMakeContent();
void DoObserve(int id, int part, void *d , Object *op);
void MakeToolList();
};
#endif ESCALANTE_H